package com.springmvc.web.majiang.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 
 * @ClassName: RedirectController 
 * @author wangruchao
 * @date 2017年12月18日 上午11:34:53
 */
@Controller
@RequestMapping
public class RedirectController {

	private static final String	index	 = "/";

	private static final String	redirect = "redirect:";

	@RequestMapping("/redirect")
	public String index(@RequestParam("url") String url) {
		if (url == null || url.length() == 0) {
			return redirect + index;
		} else {
			return "redirect:" + url;
		}
	}

}
